
** Authors: Dan Butler and Margit Tavits
** Title: "Shared Interests Foster Interethnic Cooperation Among Politicians"
** Journal: Political Science Research and Methods
** This file recreates Figure 2 in the paper


** Open the data file
use "2013 Bosnian Census.dta", clear
** The data was drawn from the Bosnian 2013 Census. 
** As of October, 2019, it was available at the following website: http://www.popis.gov.ba/popis2013/knjige.php?id=0

** Only keep the total (and not the gender breakdown)
keep if group=="Ukupno"

** Drop observations for Kantons and other larger areas 
drop if area=="BOSNA I HERCEGOVINA" | area=="FEDERACIJA BOSNE I HERCEGOVINE" | area=="FEDERACIJA BOSNE I HERCEGOVINE" | area=="BRČKO DISTRIKT BOSNE I HERCEGOVINE" | area=="REPUBLIKA SRPSKA" | regexm(area,"KANTON")==1

** Percent of population for each of the 3 main ethnicities
gen adjtot=tot-notdec-others-unknown

g p_croat=croat/adjtot
g p_bosniak=bosniak/adjtot
g p_serb=serbs/adjtot

** Create Graph
** Install the following if it is not already installed:
** ssc install triplot
#delimit;
triplot p_croat  p_bosniak  p_serb,  
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) 
ltext(Percent Croat) rtext(Percent Bosniak) btext(Percent Serb) ;
#delimit cr;

** Areas where one group is dominant 
count if p_croat>.8 | p_bos>.8 | p_serb>.8
** Total number of cities=142; cities with 1 dominant group==102.   72% where one group dominates (This point is made in the body of the paper near Figure 2)

